#include<bits/stdc++.h>
#define all(a) a.begin(), a.end()
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

//std::mt19937 rng {std::chrono::steady_clock::now().time_since_epoch().count()};

int main() {
	
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	int n;
	std::cin >> n;
	i64 ans = 0;
	for(int i = 0; i < n; i++) {
		int m;
		std::cin >> m;
		ans += m / 5 * 3;
		m %= 5;
		while(m > 0) {
			ans++;
			if(ans % 3 == 0) {
				m -= 3;
			} else {
				m--;
			}
		}
	}

	std::cout << ans;

	return 0;
}